home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / serien / purity / nr.10 / demo / sparx.i / .spark06.i < prev    next >
Text File  |  1995-04-19  |  1KB  |  69 lines

  1.  
  2. Procedure Spark06( rgbx : ColorArrayPtr );
  3. Const
  4.     max4lines = 80;
  5.  
  6.     add1 : Short = 7;    { x1 }
  7.     add2 : Short = 3;    { y1 }
  8.     add3 : Short = 13;    { x2 }
  9.     add4 : Short = 7;    { y2 }
  10.  
  11.  
  12. Type
  13.     Sp1lines    = Array[1..max4lines] of line;
  14.     Sp1LinesPtr = ^Sp1Lines;
  15.  
  16. Var
  17.     arr    : Sp1LinesPtr;
  18.     cnt1,
  19.     cnt2,
  20.     cnt3,
  21.     cnt4,
  22.     CCNT,
  23.     actualline : Short;
  24. Begin
  25.     New(arr);
  26.     ActualLine := 1;
  27.     SetSColors( rgbx );
  28.  
  29.     cnt1 := 546;    cnt2 := 3;
  30.     cnt3 := 197;    cnt4 := 401;
  31.     CCNT := 1;    { color }
  32.  
  33.     Repeat
  34.       EraseLine( Adr(arr^[actualline]) );
  35.       With arr^[actualline] do begin
  36.         x1 := 160 + XSin^[cnt1] * 4 DIV 5;    { +- max. 80 }
  37.         y1 := 120 + Xsin^[cnt2] * 3 DIV 5;    { +- max. 60 }
  38.         x2 := 160 + XSin^[cnt3] * 8 DIV 5;    { +- max.160 }
  39.         y2 := 120 + Xsin^[cnt4] * 6 DIV 5;    { +- max.120 }
  40.       end;
  41.  
  42.       cnt1 := cnt1 + add1;
  43.       if cnt1>627 then cnt1:= cnt1-628;
  44.  
  45.       cnt2 := cnt2 + add2;
  46.       if cnt2>627 then cnt2:= cnt2-628;
  47.  
  48.       cnt3 := cnt3 + add3;
  49.       if cnt3>627 then cnt3:= cnt3-628;
  50.  
  51.       cnt4 := cnt4 + add4;
  52.       if cnt4>627 then cnt4:= cnt4-628;
  53.  
  54.       DrawLine( Adr(arr^[actualline]), CCNT );
  55.  
  56.       inc( CCNT );
  57.       If CCNT > maxColors then CCNT := 2;
  58.  
  59.       inc( actualline );
  60.       If actualline >= max4lines then actualline := 1;
  61.  
  62.     Until LeftMouseButton;
  63.  
  64.     Ciao;
  65.     Dispose(arr);
  66.     SetSColors( Adr(Def_Colors) );
  67. End;
  68.  
  69.